#include<iostream>
#include<algorithm>
using namespace std;
struct Stu{
	string s1;
	float a;
	int f;
}arr[202];
bool cmp(struct Stu s1,struct Stu s2){
	return s1.a > s2.a;
}
int main(){
	int n,count = 0;
	cin >> n;
	for(int i = 0 ; i < n; i++){
		cin >> arr[i].s1 >> arr[i].a >> arr[i].f; 
			if(arr[i].a >=37.5&&arr[i].f){cout << arr[i].s1<<endl;
    	count ++;}
	}
	
	cout << count;
	return 0;
}
